package com.caimiao.miao.library.usb.accessory;

import com.caimiao.miao.library.usb.interfaces.ICmdUtil;
import com.caimiao.miao.library.usb.logic.CmdUtil;
import com.caimiao.miao.library.usb.logic.UsbCode;
import com.caimiao.miao.library.utils.DateUtil;

public class Command {
    public static ICmdUtil Util = new CmdUtil();

    private int status;//@UsbCode.Code.SCHEDULER_STATUS_WRITE//@UsbCode.Code.SCHEDULER_STATUS_READ
    private char[] command;
    private char code;
    private long interval;

    //test
    private String date;
    private int color;


    public Command(@UsbCode.Code int status, char[] command) {
        setStatus(status);
        setCommand(command);
        setDate(DateUtil.getNowTime());
        setColor(0xff333333);
    }

    public void setCommand(char[] command) {
        this.command = command;
        setCode(Util.getCode(command));
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public char[] getCommand() {
        return command;
    }

    public char getCode() {
        return code;
    }

    public void setCode(char code) {
        this.code = code;
    }

    public long getInterval() {
        return interval;
    }

    public void setInterval(long interval) {
        this.interval = interval;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public int getColor() {
        return color;
    }

    public void setColor(int color) {
        this.color = color;
    }
}
